#!bin/bash
for file in `ls`; do
    if [ -d $file ]; then
        for f in `ls $file`; do
             mv $file/$f $file/${file}.${f##*.}
        done
    fi
done
